/* eslint-disable */
export default {
  data() {
    return {
      textarea: '',
      // 资产数据
      assetData:[
        {
          contractNo: '0001201911025861',
          assetName: '***楼宇建设',
          assetType: '地价评估',
          assetNorm: '评估费',
          supplier: '1万元',
          
        },
        {
          contractNo: '0001201911025031',
          assetName: '***市政建设',
          assetType: '挂地申请',
          assetNorm: '申请费',
          supplier: '1万元',
        },
        {
          contractNo: '0001201911025031',
          assetName: '***市政建设',
          assetType: '土地出让金缴纳',
          assetNorm: '土地出让金',
          supplier: '10万元',
        },
        {
          contractNo: '0001201911024234',
          assetName: '***市政建设',
          assetType: '城市基础设施配套',
          assetNorm: '城市基础设施配套费',
          supplier: '7.5万元',
        },
        {
          contractNo: '0001201911024234',
          assetName: '***楼宇建设',
          assetType: '地价评估',
          assetNorm: '评估费',
          supplier: '1.3万元',
        },
        {
          contractNo: '0001201911027165',
          assetName: '***市政建设',
          assetType: '地价评估',
          assetNorm: '评估费',
          supplier: '5.5万元',
        },
      ],

      // 资产图片上传
      dialogImageUrl: '',
      dialogVisible: false,
      disabled: false,

      // 新增资金流弹窗
      dialogAssetAdd:{
        title: '新增资金流转记录',
        status: false,
      },

      // 新增流转记录表单数据
      assetAddFrom:{
        assetName: '',
        personalID1: '',
        personalTel1: '',
        personalTel2: '',
        personalTel3: '',
        personalTel4: '',
        monthlya: ''
      },

      // 新增资产表单验证
      assetAddRules: {
        // assetName: [
        //   { required: true, message: '', trigger: 'blur' },
        // ],
        personalID1: [
          { required: true, message: '请选择交易项', trigger: 'change' },
        ],
        personalTel1: [
          { required: true, message: '请选择转账日期', trigger: 'change' },
        ],
        personalTel2: [
          { required: true, message: '请输入付款方', trigger: 'change' },
        ],
        personalTel3: [
          { required: true, message: '请输入收款方', trigger: 'change' },
        ],
        personalTel4: [
          { required: true, message: '请输入交易金额', trigger: 'change' },
        ]
      },

      // 资产维修表单
      uerFrom:{
        assetId: '',
        providerName: '',
        providerContact: '',
        providerTel: '',
        reason: '',
      },

      // 资产维修
      dialogAssetUse:{
        title: '资产维修',
        status: false,
      },

      //  资产维修表单验证
      userRules: {
        assetId: [
          { required: true, message: '请输入资产ID', trigger: 'blur' },
        ],
        providerName: [
          { required: true, message: '请输入提供商名称', trigger: 'blur' },
        ],
        providerContact: [
          { required: true, message: '请输入提供商联系人', trigger: 'blur' },
        ],
        providerTel: [
          { required: true, message: '请输入联系方式', trigger: 'blur' },
        ],
        reason: [
          { required: true, message: '请输入维修原因', trigger: 'blur' },
        ],
      },
    }
  },
  mounted() {

  },
  methods: {
    // 资产弹窗
    dialogAsset(row){
      this.assetAddFrom = row
      this.dialogAssetAdd.status = true
    },

    // 资产照片上传
    uploadFuc(){
      this.$message({
        type: 'success',
        message: '上传失败!'
      })
    },
    successFuc(){
      this.$message({
        type: 'success',
        message: '上传成功!'
      })
    },
    handleRemove(file) {
      console.log(file);
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },

    // 资产维修弹窗
    dialogUse(row){
      this.uerFrom = {
        assetId: row.contractNo,
        providerName: '',
        providerContact: '',
        providerTel: '',
        reason: '',
      },
      this.dialogAssetUse.status = true
    },

    // 新增资金记录
    assetUse(formName){
      this.$refs[formName].validate((valid) => {
        debugger
        if (valid) {
          this.$message({
            type: 'success',
            message: '提交成功!'
          })
          this.dialogAssetUse.status = false
        } else {
          this.$message({
            type: 'warning',
            message: '请填写相关信息!'
          })
          return false;
        }
      });
    }
  }
}